<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="../../js/jquery-1.9.1.min.js"></script>
<script src="../../js/angular.min.js"></script>
<body ng-app="cemian" ng-controller="cmCtrl">
<table align="center">
    <tr>
        <td style="height: 40px;"></td>
        <td style="text-align:center;BORDER-left: #000000 1px solid;BORDER-right: #000000 1px solid;width: 40px;">800</td>
        <td style="width:12px;"></td>
    </tr>

    <tr>
        <td class="baobian10" style="text-align:center;BORDER-top: #000000 1px solid;">{{product.baobian}}</td>
        <td style="BORDER-top: #000000 1px solid;BORDER-bottom: #000000 1px solid;BORDER-left: #000000 1px solid;BORDER-right: #000000 1px solid;"></td>
        <td></td>
    </tr>
    <!--<c:if test="${first gt 0}">-->
        <tr ng-if="product.first > 0">
            <td style="BORDER-top: #000000 1px solid;BORDER-bottom: #000000 1px solid;height: 51px;">
                960
            </td>
            <td style="BORDER-top: #000000 1px solid;BORDER-bottom: #000000 1px solid;BORDER-left: #000000 1px solid;BORDER-right: #000000 1px solid;"></td>
            <td>
                <table>
                    <tr>
                        <td style="BORDER-top: #000000 1px solid;BORDER-bottom: #000000 1px solid;BORDER-left: #000000 1px solid;BORDER-right: #000000 1px solid;width:4px;height: 51px;background-image:url(../static/img/td.jpg);"></td>
                    </tr>
                </table>
            </td>
        </tr>
    <!--</c:if>-->
    <!--<c:if test="${times ge 0}">-->
        <!--<c:forEach var="i" begin="0" end="${times}">-->
            <tr ng-if="product.times > 0" ng-repeat="time in times">
                <td style="BORDER-bottom: #000000 1px solid;height: 102px;">
                    1920
                </td>
                <td style="BORDER-top: #000000 1px solid;BORDER-bottom: #000000 1px solid;BORDER-left: #000000 1px solid;BORDER-right: #000000 1px solid;"></td>
                <td style="width:4px;height: 102px;">
                    <table>
                        <tr>
                            <td style="BORDER-top: #000000 1px solid;BORDER-bottom: #000000 1px solid;BORDER-left: #000000 1px solid;BORDER-right: #000000 1px solid;width:4px;height: 51px;background-image:url(../static/img/td.jpg);"></td>
                        </tr>
                        <tr>
                            <td style="BORDER-top: #000000 1px solid;BORDER-bottom: #000000 1px solid;BORDER-left: #000000 1px solid;BORDER-right: #000000 1px solid;width:4px;height: 51px;background-image:url(../static/img/td.jpg);"></td>
                        </tr>
                    </table>
                </td>
            </tr>
        <!--</c:forEach>-->
    <!--</c:if>-->
    <tr>
        <td class="baobian10" style="BORDER-bottom: #000000 1px solid;">
            {{product.baobian}}
        </td>
        <td style="BORDER-top: #000000 1px solid;BORDER-bottom: #000000 1px solid;BORDER-left: #000000 1px solid;BORDER-right: #000000 1px solid;"></td>
    </tr>
</table>

</body>
<script src="../../globalVar.js"></script>
<script>
    var app = angular.module('cemian', []);
    app.controller('cmCtrl', function ($scope, $http) {

        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null)return unescape(r[2]);
            return null;
        }

        $scope.width = GetQueryString("width");
        $scope.height = GetQueryString("height");

        $scope.token = localStorage.getItem("token");
        var modelId = localStorage.getItem("modelId");
        if (modelId === null) {
            $scope.modelId = 1;
        } else {
            $scope.modelId = modelId
        }


        $http({
            method: "GET",
            url: url + "/product/cemian?token=" + $scope.token + "&productId=" + $scope.modelId + "&width=" + $scope.width + "&height=" + $scope.height
        }).then(
            function success(response) {
                //console.log(response.data.obj);
                $scope.product = response.data.obj;
                $(".baobian10").css("height", parseInt($scope.product.baobian) / 10 + "px");
                $scope.times = [];
                for (var i = 0; i < $scope.product.times; i++) {
                    $scope.times.push(i);
                }
            },
            function error(response) {
                location.href = "login.html";
            }
        );

    });
</script>
</html>